#pragma once

#include <cstdint>

namespace eniac
{

const int32_t INVALID_SOCKET_ID = -1;
const int32_t INVALID_SOCKET_FD = -1;
const uint16_t INVALID_SOCKET_PORT = 0;

enum class r_socket_type : uint8_t
{
    SOCKET_TYPE_IPV4_TCP_SERVER,      //IPV4 TCP Server Socket
    SOCKET_TYPE_IPV4_TCP_PARTNER,     //IPV4 TCP Accepted Socket
    SOCKET_TYPE_IPV4_TCP_CLIENT,      //IPV4 TCP Client
    SOCKET_TYPE_IPV4_UDP_SERVER,      //IPV4 UDP Socket(Server)
    SOCKET_TYPE_IPV4_UDP_PARTNER,     //IPV4 UDP Socket that Server received message from
    SOCKET_TYPE_IPV4_UDP_CLIENT,      //IPV4 UDP Socket(Client)
    SOCKET_TYPE_IPV4_UDP_MULTICAST,   //IPV4 UDP MULTICAST
    SOCKET_TYPE_IPV6_TCP_SERVER,      //IPV6 TCP Server Socket
    SOCKET_TYPE_IPV6_TCP_PARTNER,     //IPV6 TCP Accepted Socket
    SOCKET_TYPE_IPV6_TCP_CLIENT,      //IPV6 TCP Client
    SOCKET_TYPE_IPV6_UDP_SERVER,      //IPV6 UDP Socket(Server)
    SOCKET_TYPE_IPV6_UDP_PARTNER,     //IPV6 UDP Socket that Server received message from
    SOCKET_TYPE_IPV6_UDP_CLIENT,      //IPV6 UDP Socket(Client)
    SOCKET_TYPE_IPV6_UDP_MULTICAST,   //IPV6 UDP MULTICAST
    SOCKET_TYPE_DOMAIN_UDP_SERVER,    //DOMAIN UDP Socket Server 
    SOCKET_TYPE_DOMAIN_UDP_PARTNER,   //DOMAIN UDP Socket that Server received message from
    SOCKET_TYPE_DOMAIN_UDP_CLIENT,    //DOMAIN UDP Socket Client
    SOCKET_TYPE_UNKNOWN
};

enum class r_socket_property_type : uint8_t
{
    SOCKET_PROPERTY_OWN_ADDRESS,
    SOCKET_PROPERTY_OWN_PORT_NUMBER,
    SOCKET_PROPERTY_PARTNER_ADDRESS,
    SOCKET_PROPERTY_PARTNER_PORT_NUMBER,
    SOCKET_PROPERTY_SERVER_ADDRESS,
    SOCKET_PROPERTY_SERVER_PORT_NUMBER,
    SOCKET_PROPERTY_MULTICAST_ADDRESS,
    SOCKET_PROPERTY_MULTICAST_PORT,
    SOCKET_PROPERTY_MAX_ACCEPT_NUMBER
};

enum class r_socket_proxy_ret_t : uint32_t
{
    OK = 0,
    NULL_PTR,
    SOCKET_PROXY_HAS_BEEN_STARTED,
    SOCKET_PROXY_TO_CREATE_COMMAND_PIPE_FAILED,
    SOCKET_PROXY_TO_CREATE_EPOLL_OBJ_FAILED,
    SOCKET_PROXY_TO_ADD_READ_PIPE_TO_EPOLL_FAILED,
    SOCKET_OBJ_DOES_NOT_EXIST,
    SOCKET_OBJ_HAS_BEEN_STARTED,
    SOCKET_OBJ_HAD_NOT_BEEN_STARTD,
    SOCKET_OBJ_OF_TYPE_CAN_NOT_BE_CREATED,
    THE_SOCKET_TYPE_IS_NOT_SUPPORTED_TO_BE_CREATED,
    THE_SOCKET_TYPE_IS_NOT_SUPPORTED_TO_BE_SET_PROPERTY,
    THE_SOCKET_TYPE_IS_NOT_SUPPORTED_TO_SEND_MESSAGE,
    INVALID_PROPERTY_TYPE_FOR_THE_SOCKET,
    INVALID_PROPERTY_LENGTH,
    INVALID_PROPERTY_VALUE,
    INVALID_SOCKET_FD,
    OWN_ADDRESS_HAS_NOT_BEEN_SET_YET,
    OWN_PORT_HAS_NOT_BEEN_SET_YET,
    MULTICAST_ADDRESS_HAS_NOT_BEEN_SET_YET,
    MULTICAST_PORT_HAS_NOT_BEEN_SET_YET,
    SERVER_ADDRESS_HAS_NOT_BEEN_SET_YET,
    SERVER_PORT_HAS_NOT_BEEN_SET_YET,
    MAX_LISTEN_NUMBER_HAS_NOT_BEEN_SET_YET,
    SOCKET_FD_HAS_BEEN_SET,
    TO_CREATE_SOCKET_FD_IS_FAILED,
    TO_BIND_ADDRESS_TO_FD_IS_FAILED,
    TO_START_LISTEN_FD_IS_FAILED,
    TO_ACCEPT_SOCKET_IS_FAILED,
    TO_READ_DATA_FROME_SOCKET_IS_FAILED,
    TO_CONNECT_SERVER_IS_FAILED,
    TO_SEND_DATA_IS_FAILED,
    TO_SET_SOCKET_BROADCAST_IS_FAILED,
    TO_SET_SOCKET_REUSE_IS_FAILED,
    TO_SET_SOCKET_BROADCAST_ADDR_IS_FAILED,
    TO_SET_SOCKET_TTL_IS_FAILED,
    TO_SET_SOCKET_NO_LOOP_IS_FAILED,
    HOST_SOCKET_OBJ_IS_NOT_FOUND,
    HOST_SOCKET_FD_IS_INVALID,
    NO_DATA_CAN_BE_READ,
    NO_DATA_CAN_BE_SENT,
    NOT_FINISHED_YET
};


}